package cn.aitstone.basic.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
 * @Description: AjaxResult数据返回封装类
 * @Author: Sheldon
 * @Version: 1.0
 * @Date:  2022/7/1 21:23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AjaxResult {
    private Boolean success = true;
    private String message = "操作成功";
    private Object resultObj;

    // 创建AjaxResult对象的静态方法
    public static AjaxResult me(){
        return new AjaxResult();
    }

    // 自定义的set方法
    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    // 自定义的set方法
    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }

    public AjaxResult setResultObj(Object resultObj){
        this.resultObj = resultObj;
        return this;
    }

}
